﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace J_Controle
{
    public partial class FrmConfigPorta : Form
    {
        ConfigPorta CnfAtual;

        public FrmConfigPorta(ConfigPorta prmPorta)
        {
            CnfAtual = prmPorta;
            InitializeComponent();
        }

        private void FrmConfigPorta_Load(object sender, EventArgs e)
        {
            lstNome.SelectedItem = CnfAtual.Nome;
            lstBps.SelectedItem = CnfAtual.BpsText;
            lstPty.SelectedItem = CnfAtual.PtyText;
            lstStop.SelectedItem = CnfAtual.StopText;
            lstReplace.SelectedItem = CnfAtual.ParityReplaceText;
        }

        private void FrmConfigPorta_FormClosing(object sender, FormClosingEventArgs e)
        {
            CnfAtual.Nome = (string)lstNome.SelectedItem;
            CnfAtual.BpsText = (string)lstBps.SelectedItem;
            CnfAtual.PtyText = (string)lstPty.SelectedItem;
            CnfAtual.StopText = (string)lstStop.SelectedItem;
            CnfAtual.ParityReplaceText = (string)lstReplace.SelectedItem;
        }
    }
}
